<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        table{
            width: 700px;
            border-collapse:collapse;
        }
        td,th{
            border:  1px solid #ccc;
            padding: 10px;
        }
        th{
            background-color: skyblue;
        }
    </style>
</head>
<body>
    <div id="root">
        <table>
            <thead>
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>住址</th>
                    <th>电话</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item,index) in students">
                    <td>{{item.id}}</td>
                    <td>{{item.name}}</td>
                    <td>{{item.age}}</td>
                    <td>{{item.gender==1?'男':'女'}}</td>
                    <td>{{item.address}}</td>
                    <td>{{item.mobilePhone}}</td>
                </tr>
            </tbody>
        </table>

    </div>
    <script>
        new Vue({
            el:'#root',
            data(){
                return{
                    students:[
                        {
                            id:'1001',
                            name:'孙维',
                            age:23,
                            gender:1,
                            address:'陕西省西安市凤城1路100号',
                            mobilePhone:'13324567899'
                        },
                        {
                            id:'1002',
                            name:'张美丽',
                            age:22,
                            gender:0,
                            address:'陕西省西安市凤城1路200号',
                            mobilePhone:'13324567899'
                        },
                        {
                            id:'1003',
                            name:'黄世仁',
                            age:33,
                            gender:1,
                            address:'陕西省西安市凤城1路300号',
                            mobilePhone:'13324567898'
                        }
                    ]
                }
            }
        })
    </script>
</body>
</html>